<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <input type="button" value="-" id="minusBtn">
    <span id="num">5</span>
    <input type="button" value="+" id="addBtn">

    <script>
        let addBtn = document.querySelector('#addBtn');
        // DOM0 
        addBtn.onclick = function () {
            num.innerText++;
        }
        minusBtn.onclick = function () {
            if (num.innerText > 0) {
                num.innerText--;
            }
        }
        // DOM2
        // addBtn.addEventListener('click', function () {

        // });
    </script>
</body>

</html>